import os
import sys
from collections import deque

# 请在此输入您的代码
n,m = map(int,input().split())
start_x,start_y,end_x,end_y = map(int,input().split())
board = [['.' for _ in range(m)]for _ in range(n)]
for k in range(n):
  board[k] = list(input())

visted = [[False for _ in range(m)]for _ in range(n)]
colors = [[[0,0] for _ in range(m)]for _ in range(n)]

def dfs(point_x,point_y,color):
  if point_x < 0  or point_x >= n: return
  if point_y < 0  or point_y >= m: return
  if board[point_x][point_y] == '#': 
    colors[point_x][point_y][color] = 1
    return
  
  if visted[point_x][point_y]: return

  visted[point_x][point_y] = True
  dfs(point_x+1,point_y,color)
  dfs(point_x-1,point_y,color)
  dfs(point_x,point_y+1,color)
  dfs(point_x,point_y-1,color)


dfs(start_x-1,start_y-1,0)
dfs(end_x-1,end_y-1,1)
status = "No"
for i in range(n):
  for j in range(m):
    if colors[i][j] == [1,1]:
      status = "Yes"
print(status)